package com.ls.service.combine.impl;

import com.ls.entity.HeadLine;
import com.ls.entity.ShopCategory;
import com.ls.entity.dto.MainPageInfoDTO;
import com.ls.entity.dto.Result;
import com.ls.service.combine.HeadLineShopCategoryService;
import com.ls.service.solo.HeadLineService;
import com.ls.service.solo.ShopCategoryService;
import org.simpleframework.core.annotation.Service;
import org.simpleframework.inject.annotation.Autowired;

import java.util.List;

/**
 * @program: simpleframework
 * @description:
 * @author: lishuang
 * @create: 2021-11-22 09:30
 **/
@Service
public class HeadLineShopCategoryServiceImpl implements HeadLineShopCategoryService {
    @Autowired
    private HeadLineService headLineService;
    @Autowired
    private ShopCategoryService shopCategoryService;
    @Override
    public Result<MainPageInfoDTO> getPageInfo() {
        //1 获取头条列表
        HeadLine headLine = new HeadLine();
        headLine.setEnableStatus(1);
        Result<List<HeadLine>> headListList = headLineService.queryHeadLine(headLine, 1, 4);
        //2 获取类别列表
        ShopCategory category = new ShopCategory();
        Result<List<ShopCategory>> shopCategoryResult = shopCategoryService.queryShopCategory(category, 1, 100);

        //3 合并返回
        Result<MainPageInfoDTO>  result =  mergeMainPageInfo(headListList,shopCategoryResult);
        return result;
    }

    private Result<MainPageInfoDTO> mergeMainPageInfo(Result<List<HeadLine>> headListList, Result<List<ShopCategory>> shopCategoryResult) {
        return  null;
    }
}
